package com.lin.service.impl;

import com.lin.entity.DynamicData;
import com.lin.mapper.DynamicDataMapper;
import com.lin.service.DynamicDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class DynamicDataServiceImpl implements DynamicDataService {
    @Autowired
    private DynamicDataMapper dynamicDataMapper;

    /**
     * 点赞收藏转发
     * @param dynamicData
     */
    public void setDynamic(DynamicData dynamicData) {
        dynamicData.setTime(LocalDateTime.now());
        dynamicDataMapper.setDynamic(dynamicData);
    }

    /**
     * 取消点赞收藏
     * @param dynamicData
     */
    public boolean delete(DynamicData dynamicData) {
        return dynamicDataMapper.delete(dynamicData);
    }
}
